﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<ComputerShopE3.Models.DANH_GIA>>" %>
<%@ Import Namespace="MyHelper" %>
<%@ Import Namespace="ComputerShopE3.Models" %>

<fieldset>    
    <legend>Diem danh gia cua nguoi dung</legend>
    <table>
        <tr>
            <th>
                Người đánh giá
            </th>
            <th>
                Điểm
            </th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                 <%item.NGUOI_DUNGReference.Load(); %>
                 <%= Html.Encode(item.NGUOI_DUNG.Ten) %>
            </td>
            <td>
                <% var Diem = (item.Diem > 5) ? 5 : item.Diem; %>
                <% for (int i = 0; i < Diem; i++) { %>
                <img src="../../Content/images/choice.png" />
                <% } 
                    Diem = 5 - Diem;
                    for (int i = 0; i < Diem; i++) { %>
                <img src="../../Content/images/nochoice.png"/>
                <% } %>
            </td>
        </tr>
    
    <% } %>

    </table>

    <p>
        <%= Html.ActionLink("Tạo mới", "Create", "Grade", new { id = ((SAN_PHAM)ViewData["SAN_PHAM"]).id }, null)%>
    </p>
</fieldset>


